//
//  AppUI.h
//  mbstore
//
//  Created by huangyi on 14-3-12.
//  Copyright (c) 2014年 huangyi. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "Fmwk.h"
#import "SQLiteKit.h"
#import "HTTPClient.h"
#import "MBProgressHUD.h"

FOUNDATION_EXPORT NSString *const ItemListNotification;
FOUNDATION_EXPORT NSString *const ShoppingListNotification;
FOUNDATION_EXPORT NSString *const ChangSelcetType;
@interface MainApp : NSObject

@property(nonatomic,strong)NSMutableArray *shoppingList;
@property(nonatomic,strong)NSMutableArray *itemList;
@property(nonatomic,strong)NSMutableArray *promotionList;
@property(nonatomic,strong)SQLiteKit *sqlite;

@property(nonatomic,strong)NSMutableDictionary *skuInfoCache;

+(instancetype)mainApp;
-(NSDictionary*)requestProduct:(NSString*)skuId;
-(NSArray*)requestPromotion;

@end

@interface AppUI : UIViewController

//@property(nonatomic,weak)MainApp *app;
-(void)presentWithNavigationController:(UIViewController*)controller;
-(void)AddChildWithNavigationController:(UIView *)controller;
-(void)RemoveFormParent:(CGFloat)time;
+(NSArray*)getMainTree;
+(NSArray*)getSubTree:(NSString*)mainTree;
+(NSArray*)getAllSuit;
+(NSArray*)getSuitByScan:(NSString*)scan;
+(NSArray*)getSuitByTree:(NSArray*)tree;
+(NSArray*)getProductByTree:(NSArray*)tree;
+(NSDictionary*)getSuitDict:(NSString*)itemId;
+(NSArray*)getProductBySuit:(NSString*)itemId;
+(NSDictionary*)getProductDict:(NSString*)skuId;
+(NSArray*)getProductSku:(NSString*)itemId;
+(NSDictionary*)getSkuDict:(NSString*)skuId;
+(NSString*)getSkuId:(NSString*)colorAndSize forItem:(NSString*)itemId;
+(NSString*)getImageURL:(NSString*)imageName;

+(NSArray*)getFirstUpperTree;
+(NSArray*)getFirstLowerTree;
//判断纯数字
+ (BOOL)isPureInt:(NSString*)string;
+(HTTPClient*)getStock:(NSString*)skuId;
+(HTTPClient*)getProduct:(NSString*)skuId;
+(HTTPClient*)getDiscount:(NSArray*)skuIds;
+(HTTPClient*)getPromotion;
+(HTTPClient*)setPromotion:(NSArray*)promotions;

@end

